import 'package:base_flutter/base_flutter.dart';

import '../../../model/food/send_food_model.dart';

/// breakfashGoodsInfo : "1:海之蓝,1:酸辣土豆丝"
/// buildingId : 74
/// buildingName : "22号楼"
/// dinnerGoodsInfo : null
/// elderHumanId : 7624
/// elderHumanName : "周家敏"
/// elderHumanRoom : null
/// exportType : null
/// floorId : 173
/// floorName : null
/// goodsInfo : "1:海之蓝,1:酸辣土豆丝"
/// lunchGoodsInfo : null
/// roomId : 1770
/// roomNo : "401"
/// useDate : "2022-09-20 00:00:00"
/// useTimeSection : 1

class SendFoodTableData extends ISendFoodTableData{
  SendFoodTableData({
      this.breakfashGoodsInfo, 
      this.buildingId, 
      this.buildingName, 
      this.dinnerGoodsInfo, 
      this.elderHumanId, 
      this.elderHumanName, 
      this.elderHumanRoom, 
      this.exportType, 
      this.floorId, 
      this.floorName, 
      this.goodsInfo, 
      this.lunchGoodsInfo, 
      this.roomId, 
      this.roomNo, 
      this.useDate, 
      this.useTimeSection,});

  SendFoodTableData.fromJson(dynamic json) {
    breakfashGoodsInfo = json['breakfashGoodsInfo'];
    buildingId = json['buildingId'];
    buildingName = json['buildingName'];
    dinnerGoodsInfo = json['dinnerGoodsInfo'];
    elderHumanId = json['elderHumanId'];
    elderHumanName = json['elderHumanName'];
    elderHumanRoom = json['elderHumanRoom'];
    exportType = json['exportType'];
    floorId = json['floorId'];
    floorName = json['floorName'];
    goodsInfo = json['goodsInfo'];
    lunchGoodsInfo = json['lunchGoodsInfo'];
    roomId = json['roomId'];
    roomNo = json['roomNo'];
    useDate = json['useDate'];
    useTimeSection = json['useTimeSection'];
  }
  String? breakfashGoodsInfo;
  num? buildingId;
  String? buildingName;
  String? dinnerGoodsInfo;
  num? elderHumanId;
  String? elderHumanName;
  String? elderHumanRoom;
  String? exportType;
  num? floorId;
  String? floorName;
  String? goodsInfo;
  String? lunchGoodsInfo;
  num? roomId;
  String? roomNo;
  String? useDate;
  num? useTimeSection;
SendFoodTableData copyWith({  String ?breakfashGoodsInfo,
  num? buildingId,
  String? buildingName,
  dynamic dinnerGoodsInfo,
  num? elderHumanId,
  String? elderHumanName,
  dynamic elderHumanRoom,
  dynamic exportType,
  num? floorId,
  dynamic floorName,
  String? goodsInfo,
  dynamic lunchGoodsInfo,
  num? roomId,
  String? roomNo,
  String? useDate,
  num? useTimeSection,
}) => SendFoodTableData(  breakfashGoodsInfo: breakfashGoodsInfo ?? this.breakfashGoodsInfo,
  buildingId: buildingId ?? this.buildingId,
  buildingName: buildingName ?? this.buildingName,
  dinnerGoodsInfo: dinnerGoodsInfo ?? this.dinnerGoodsInfo,
  elderHumanId: elderHumanId ?? this.elderHumanId,
  elderHumanName: elderHumanName ?? this.elderHumanName,
  elderHumanRoom: elderHumanRoom ?? this.elderHumanRoom,
  exportType: exportType ?? this.exportType,
  floorId: floorId ?? this.floorId,
  floorName: floorName ?? this.floorName,
  goodsInfo: goodsInfo ?? this.goodsInfo,
  lunchGoodsInfo: lunchGoodsInfo ?? this.lunchGoodsInfo,
  roomId: roomId ?? this.roomId,
  roomNo: roomNo ?? this.roomNo,
  useDate: useDate ?? this.useDate,
  useTimeSection: useTimeSection ?? this.useTimeSection,
);
  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['breakfashGoodsInfo'] = breakfashGoodsInfo;
    map['buildingId'] = buildingId;
    map['buildingName'] = buildingName;
    map['dinnerGoodsInfo'] = dinnerGoodsInfo;
    map['elderHumanId'] = elderHumanId;
    map['elderHumanName'] = elderHumanName;
    map['elderHumanRoom'] = elderHumanRoom;
    map['exportType'] = exportType;
    map['floorId'] = floorId;
    map['floorName'] = floorName;
    map['goodsInfo'] = goodsInfo;
    map['lunchGoodsInfo'] = lunchGoodsInfo;
    map['roomId'] = roomId;
    map['roomNo'] = roomNo;
    map['useDate'] = useDate;
    map['useTimeSection'] = useTimeSection;
    return map;
  }


  @override
  String get iRoomName => roomNo??"";

  @override
  String get iOldName => elderHumanName??"";

  @override
  String get iBreakfast => breakfashGoodsInfo.isNullOrEmpty()?"":(breakfashGoodsInfo??"").split(",").map((e) => "${e}").join("\n");

  @override
  String get iLaunch => lunchGoodsInfo.isNullOrEmpty()?"":(lunchGoodsInfo??"").split(",").map((e) => "${e}").join("\n");

  @override
  String get iDinner => dinnerGoodsInfo.isNullOrEmpty()?"":(dinnerGoodsInfo??"").split(",").map((e) => "${e}").join("\n");
}